<script setup>
    import { getCurrentInstance, ref, reactive } from 'vue';
    const axios = getCurrentInstance().proxy.$http;
    const props = defineProps(['id']);
    
    const data= ref({});
    (async () => {
        const res = await axios.get(`/playlist/detail/dynamic?id=${props.id}`)
        data.value = res.data;
    })();
</script>

<template>
    <!-- 功能区域 -->
    <div class="fun">
        <button>
            <div class="play" @click="play">
                <el-icon class="play-play"><video-play /></el-icon>
                <span>播放</span>
            </div>
            <el-icon class="add"><plus /></el-icon>
        </button>
        <button>
            <el-icon><document-add /></el-icon>
            <!-- 收藏 -->
            <span>{{ data.bookedCount}}</span>
        </button>
        <button>
            <el-icon><share /></el-icon>
            <!-- 分享 -->
            <span>{{ data.shareCount}}</span>
        </button>
        <button>
            <el-icon><sort /></el-icon>
            <span>下载</span>
        </button>
        <button>
            <el-icon><comment /></el-icon>
            <span>{{ data.commentCount}}</span>
        </button>
    </div>    
</template>

<style lang='less' scoped>
    // 功能区
    .fun{
        margin-top: 5px;
        display: flex;
        width: 100%;
        margin-bottom: 20px;
        button{
            margin-top: 10px;
            margin-right: 8px;
            font-size: 13px;
            background-color: #e6e4e4;
            cursor: pointer;
            padding: 4px 5px;
            border: 1px solid rgb(189, 188, 188);
            border-radius: 5px;
            display: flex;
            align-items: center;
            color: rgb(78, 78, 78);
            span{
                margin-left: 5px;
            }
            &:hover{
                border: 1px solid rgb(226, 226, 226);
            }
            &:first-child{
                background-color: rgb(33, 72, 179);
                color: white;
                position: relative;
                border: 1px solid black;
                .play{
                    display: flex;
                    align-items: center;
                    .play-play{
                        font-size: 17px;
                    }
                    span{
                        margin-top: -2px;
                        margin-right: 20px;
                        padding-right: 8px;
                        margin-left: 2px;
                    }
                    &:hover{
                        color: rgb(46, 175, 104);
                    }
                }
                .add{
                    border-left: 1px solid black;
                    padding: 0 5px;
                    position: absolute;
                    height: 100%;
                    right: 0;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    &:hover{
                        color: white;
                        background-color: rgb(61, 101, 161);
                    }
                }
            }
        }
        
    }
</style>